<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright   Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<div class="filters">
    <button class="action filters-toggle" data-bind="click: toggle, css: { active: isVisible }">
        <span data-bind="text: $t('Filter')"></span>
    </button>
    <div class="form filters-form" data-bind="visible: isVisible" data-part="filter-form">
        <fieldset class="filters-fieldset fieldset">
            <legend class="legend filters-legend">
                <span data-bind="text: $t('Advanced filter')"></span>
            </legend><br />
            <!-- ko foreach: { data: filters, as: 'item' } -->
            <!-- ko template: $parent.getTemplateFor(item) --><!-- /ko -->
            <!-- /ko -->
        </fieldset>
        <div class="actions filters-actions">
            <button class="action secondary action-reset" data-bind="click: reset" type="button"><span data-bind="text: $t('Reset')"></span></button>
            <button class="action primary action-apply" data-bind="click: apply" type="button"><span data-bind="text: $t('Apply')"></span></button>
            <button class="action secondary action-close" data-bind="click: close" type="button"><span data-bind="text: $t('Close')"></span></button>
        </div>
    </div>
    <div class="filters-current" data-bind="css: {active: active().length}">
        <ul class="filters-items items">
            <!-- ko foreach: { data: active, as: 'filter' } -->

            <li class="filters-item item">
                <strong class="item-label" data-bind="text: $t(filter.title)"></strong>
                <span class="item-value" data-bind="text: $t(filter.output)"></span>
                <button data-bind="click: $parent.onClear(filter)" type="button" class="action action-remove"><span data-bind="text: $t('Remove')"></span></button>
            </li>

            <!-- /ko -->
        </ul>
        <button data-bind="click: reset" class="action action-clear">
            <span data-bind="text: $t('Clear all')"></span>
        </button>
    </div>
</div>
